/**
 * Created by siqing on 2017/3/25.
 */
var myApp = angular.module('music',['ui.router']);

myApp.controller('login',function($scope,$http,$filter){
    $scope.login={};

    $scope.login.time = new Date();
    $scope.login.time = $filter('date')($scope.login.time,'yyyy/MM/dd__EEE__HH:mm:ss');

    $scope.trun = function(){
        $scope.isShow = !$scope.isShow;
        $scope.isHide = !$scope.isHide;
        $scope.show = document.getElementById('input_2');
        if( ($scope.isShow ==true)&&($scope.isHide == false))
        {
            $scope.show.type='password';
        }
        if(($scope.isShow ==false)&&($scope.isHide == true)){
            $scope.show.type='text';
        }
    };

    $scope.save = function(){
        $http({
            method:'post',
            url:'', /*获取前端信息的后台文件*/
            data:$scope.login,
            header:{
                'Content-Type': 'application/json'
            }
        }).success(function(data,status,headers,config){
            console.log('提交成功');
            console.log($scope.login);
        }).error(function(data,status,headers,config){
            alert('请检查网络');
        })
    }

});